/*    */ package com.zimbra.cs.account.accesscontrol;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import java.util.HashSet;
/*    */ import java.util.Set;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PresetRight
/*    */   extends AdminRight
/*    */ {
/*    */   PresetRight(String name)
/*    */   {
/* 27 */     super(name, Right.RightType.preset);
/*    */   }
/*    */   
/*    */   public boolean isPresetRight()
/*    */   {
/* 32 */     return true;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   Set<TargetType> getGrantableTargetTypes()
/*    */   {
/* 41 */     Set<TargetType> targetTypes = new HashSet();
/* 42 */     for (TargetType targetType : this.mTargetType.inheritFrom()) {
/* 43 */       targetTypes.add(targetType);
/*    */     }
/* 45 */     return targetTypes;
/*    */   }
/*    */   
/*    */   boolean grantableOnTargetType(TargetType targetType)
/*    */   {
/* 50 */     return targetType.isInheritedBy(this.mTargetType);
/*    */   }
/*    */   
/*    */   boolean overlaps(Right other) throws ServiceException
/*    */   {
/* 55 */     if (other.isPresetRight())
/* 56 */       return this == other;
/* 57 */     if (other.isAttrRight())
/* 58 */       return false;
/* 59 */     if (other.isComboRight()) {
/* 60 */       return ((ComboRight)other).containsPresetRight(this);
/*    */     }
/* 62 */     throw ServiceException.FAILURE("internal error", null);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/accesscontrol/PresetRight.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */